package com.lago;

import org.apache.dubbo.common.extension.Activate;
import org.apache.dubbo.rpc.*;

/**
 * @Author zhangfd
 * @Date 2020/5/11 16:16
 * @Version 1.0
 * @Describe：
 */
@Activate(
  group = {"provider"}
)
public class TransportIpFilter implements Filter {

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        String ip = RpcContext.getContext().getAttachment("ip");
        System.out.println("------- ip地址："+ip);
        return invoker.invoke(invocation);
    }
}
